package com.geotmt.billingcenter.modules.cost.mapper;

import com.geotmt.billingcenter.common.entry.CostBaseEntry;
import com.geotmt.billingcenter.common.vo.cost.CostHisVo;
import com.geotmt.billingcenter.common.vo.cost.CostVo;
import com.geotmt.billingcenter.common.vo.params.ParamsConsume;
import com.geotmt.billingcenter.common.vo.params.ParamsCost;
import com.geotmt.billingcenter.common.vo.params.ParamsForDel;
import com.geotmt.billingcenter.modules.cost.mapper.provider.CostBaseProvider;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Description 成本Base DAO
 * @Author      yanghanwei
 * @Mail        yanghanwei@geotmt.com
 * @Date        2019/3/19 19:02
 * @Version     v1
 **/
@Mapper
public interface CostBaseMapper {

    /**
     * 成本 add base
     * @param costBase
     * @return
     */
    @InsertProvider(type = CostBaseProvider.class, method = "add")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    void addBase(CostBaseEntry costBase);

    /**
     * 成本 update base
     * @param consumeVo
     * @return
     */
    @UpdateProvider(type = CostBaseProvider.class, method = "update")
    int updateBase(CostVo consumeVo);

    /**
     * 成本 delete base
     * @param obj
     * @return
     */
    @UpdateProvider(type = CostBaseProvider.class, method = "delete")
    int deleteBase(ParamsForDel obj);

    /**
     * 成本 list
     * @param obj
     * @return
     */
    @SelectProvider(type = CostBaseProvider.class, method = "list")
    List<CostVo> listCurr(ParamsCost obj);

    /**
     * 添加或修改的回显
     * @param obj
     * @return
     */
    @SelectProvider(type = CostBaseProvider.class, method = "listAll")
    List<CostVo> listAll(ParamsCost obj);

    /**
     * 成本 getById
     * @param id
     * @return
     */
    @SelectProvider(type = CostBaseProvider.class, method = "getById")
    CostVo currGetById(Integer id);

    /**
     * 获取有效规则
     * @param dsId
     * @param outInterfaceId
     * @param dateDay
     * @return
     */
    @SelectProvider(type = CostBaseProvider.class, method = "getCost")
    CostHisVo getCost(@Param(value = "dsId") int dsId,
                      @Param(value = "outInterfaceId") int outInterfaceId,
                      @Param(value = "dateDay") String dateDay);

}
